The Internet of Things (IoT) is a network of objects interconnected via the Internet, enabling communication and information exchange among them to enhance the quality of human life. Despite its numerous advantages, IoT still faces challenges such as data security, privacy concerns, and high energy consumption of sensors. In this paper, a novel optimized hybrid architecture named "BlockC-SDOT" is proposed, leveraging blockchain and Software-defined networking (SDN) Architectures on a cloud computing platform for IoT. This innovative architecture combines a blockchain framework based on the Proof of Stake (PoS) consensus algorithm with SDN and cloud computing to enhance IoT performance and security. Through network clustering and cluster management via SDN, the architecture simultaneously addresses two critical parameters: sensor energy consumption and latency reduction in IoT networks. For enhanced security, the Diffie-Hellman algorithm and digital signatures are employed. Optimization is achieved using the Whale Optimization Algorithm (WOA) and the Jackson queueing model. To evaluate the efficiency of the proposed architecture, simulations are conducted to analyze various parameters, including latency, CPU performance under different attacks, throughput, energy consumption, packet arrival rate, and network bandwidth. These parameters are computed using the proposed method and compared against the results of the Ant Colony Optimization (ACO) and Genetic Algorithm (GA). Additionally, the latency of the proposed architecture is compared with the results obtained from RPL and CARP routing protocols. In both areas, the findings demonstrate the superiority and higher efficiency of the proposed hybrid approach over existing methods in the field.